import type { AxiosRequestConfig, AxiosResponse } from 'axios'

export interface RequestInterceptors<T = AxiosResponse> {
  requestInterceptor?: (config: AxiosRequestConfig) => AxiosRequestConfig
  requestErrorInterceptor?: (error: any) => any
  /*  responseInterceptor?: (response: any) => any  综合考虑可以使用 any*/
  responseInterceptor?: (response: T) => T
  responseErrorInterceptor?: (error: any) => any
}

// 请求配置接口
export interface RequestConfig<T = AxiosResponse> extends AxiosRequestConfig {
  inerceptors?: RequestInterceptors<T>
  // 扩展配置
  showLoading?: boolean
}
